<template>
  <div>
<!-- 	  <div class="demo-input-suffix">
		<el-button type="primary" icon="el-icon-search">搜索</el-button>
	  	<el-input
	  	placeholder="请输入内容"
	  	prefix-icon="el-icon-search"
	  	v-model="input2" style="width: 25%;">
	  	</el-input>
		<el-button type="success" style="float: right;margin-bottom: 10px;" round>导出</el-button>
	  </div> -->
    <template>
      <el-table
        :data="tableData5"
        style="width: 100%">
        <el-table-column
          prop="sendname"
          label="发送者"
		  width="70px"
        >
        </el-table-column>
        <el-table-column
          prop="sendMsg"
          label="学院班级"
         >
        </el-table-column>
        <el-table-column
          prop="liuyan"
          label="留言"
        >
        </el-table-column>
		<el-table-column
		  prop="songmsg"
		  label="歌曲"
		>
		</el-table-column>
		<el-table-column
		  prop="receiver"
		  label="接受者"
		  width="70px"
		>
		</el-table-column>
		<el-table-column
		  prop="createTime"
		  label="订单时间"
		>
		</el-table-column>
		<el-table-column
		  prop="wantTime"
		  label="需求时间"
		>
		</el-table-column>
		<el-table-column
		  prop="trimMsg"
		  label="调剂说明"
		>
		</el-table-column>
		<el-table-column
		  prop="realTime"
		  label="真实播放时间"
		>
		</el-table-column>
      </el-table>
    </template>
		<div class="block" style="margin-top: 10px;">
			<el-pagination background layout="prev, pager, next" :page-size='4' :total="total" :current-page="currentPage"
			 @current-change="handleCurrentChange">
			</el-pagination>
		</div>
  </div>
</template>

<script>
export default {
  name: 'filterTable',
  data () {
    return {
      tableData5: [{
		  sendname: '张三疯',
		  sendMsg: '家里蹲学院18网络',
		  liuyan: '漫漫人生路，有你相伴，感谢过往！',
		  songmsg: '张三的《大海》',
		  receiver: '秦川往',
		  createTime: '2020-12-12 00:00:00',
		  wantTime: '2020-12-13 12:00:00',
		  trimMsg: '如果冲突，就往后一天的中午播放',
		  realTime: '2020-12-15 12:00:00'
      },{
		  sendname: '张三疯',
		  sendMsg: '家里蹲学院18网络',
		  liuyan: '漫漫人生路，有你相伴，感谢过往！',
		  songmsg: '张三的《大海》',
		  receiver: '秦川往',
		  createTime: '2020-12-12 00:00:00',
		  wantTime: '2020-12-13 12:00:00',
		  trimMsg: '如果冲突，就往后一天的中午播放',
		  realTime: '2020-12-15 12:00:00'
      },{
		  sendname: '张三疯',
		  sendMsg: '家里蹲学院18网络',
		  liuyan: '漫漫人生路，有你相伴，感谢过往！',
		  songmsg: '张三的《大海》',
		  receiver: '秦川往',
		  createTime: '2020-12-12 00:00:00',
		  wantTime: '2020-12-13 12:00:00',
		  trimMsg: '如果冲突，就往后一天的中午播放',
		  realTime: '2020-12-15 12:00:00'
      },{
		  sendname: '张三疯',
		  sendMsg: '家里蹲学院18网络',
		  liuyan: '漫漫人生路，有你相伴，感谢过往！',
		  songmsg: '张三的《大海》',
		  receiver: '秦川往',
		  createTime: '2020-12-12 00:00:00',
		  wantTime: '2020-12-13 12:00:00',
		  trimMsg: '如果冲突，就往后一天的中午播放',
		  realTime: '2020-12-15 12:00:00'
      }],
	  total: 60,
	  currentPage: 1,
    }
  },
  created() {
	  this.axios.get(this.server + '/songManage/getTable?page=1&token=' + this.store.getters.token).then(res => {
		  if(res != '0') {
				this.tableData5 = res.data.tableData
				this.total = res.data.total
		  }else {
			  this.$message.error("获取数据失败！")
		  }
	  },res=> {
		  this.$message.error("网络连接失败！")
	  })
  },
  methods: {
	  handleCurrentChange(val) {
		  this.axios.get(this.server + '/songManage/getTable?page=' + val + '&token=' + this.store.getters.token).then(res => {
			  if(res != '0') {
					this.tableData5 = res.data.tableData
					// this.total = res.data.total
			  }else {
				  this.$message.error("获取数据失败！")
			  }
		  },res=> {
			  this.$message.error("网络连接失败！")
		  })
	  }
  }
}
</script>

<style scoped>

</style>
